package com.aditya.videoutil;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.ShareActionProvider;

public class VideoUtilHomeActivity extends VideoActivity {
  private ShareActionProvider mShareActionProvider;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_video_util_home);

  }

  public void compressVideo(View view) {
    System.out.println("compressVideo called ");
    Intent intent = new Intent(this, CompressVideoActivity.class);
    startActivity(intent);
  }

  public void makemovie(View view) {
    System.out.println("makemovie called....");
    Intent intent = new Intent(this, MakeMovieActivity.class);
    startActivity(intent);
  }

  @SuppressLint("NewApi")
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.video_util_home, menu);

    // // Associate searchable configuration with the SearchView
    // SearchManager searchManager = (SearchManager)
    // getSystemService(Context.SEARCH_SERVICE);
    // SearchView searchView = (SearchView)
    // menu.findItem(R.id.action_search).getActionView();
    // searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    //
    // // Locate MenuItem with ShareActionProvider
    // MenuItem item = menu.findItem(R.id.menu_item_share);
    //
    // // Fetch and store ShareActionProvider
    // mShareActionProvider = (ShareActionProvider) item.getActionProvider();

    // Return true to display menu
    return true;
  }

  // Call to update the share intent
  private void setShareIntent(Intent shareIntent) {
    if (mShareActionProvider != null) {
      mShareActionProvider.setShareIntent(shareIntent);
    }
  }

}
